﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
namespace Goldlight.SampleApplication
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    [Export("MainWindow", typeof(Window))]
    public partial class MainWindow : Window
    {
        private CompositionContainer _container;

        public MainWindow()
        {
            InitializeComponent();

        }

        public void Compose()
        {
            AggregateCatalog catalog = new AggregateCatalog();
            catalog.Catalogs.Add(new DirectoryCatalog(@".\Plugins"));

            _container = new CompositionContainer(catalog);

            CompositionBatch batch = new CompositionBatch();
            // We've put an Import on the MainWindow so that we can add this to the composition batch.
            batch.AddPart(this);

        }

    }
}
